﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IOEntity;
using System.IO;

namespace IOBusiness
{
   public class clsBSGetHTMLHotel
    {
       public String getHTML(string src, clsTemHotel temp)
        {
            try
            {
                String s = "";
                using (StreamReader sr = new StreamReader(src))
                {
                    String line;

                    while ((line = sr.ReadLine()) != null)
                    {
                        s += line;
                    }

                }
                return updateContentTemp(s, temp); ;
            }
            catch (Exception)
            {

                throw;
            }
        }


        private string updateContentTemp(string content, clsTemHotel temp)
        {
            try
            {
                string myContent = "";
                myContent = content.Replace("[1]", temp.Hotel);
                myContent = myContent.Replace("[2]", temp.Mr);
                myContent = myContent.Replace("[3]", temp.Name);
                myContent = myContent.Replace("[4]", temp.Email);
                myContent = myContent.Replace("[5]", temp.Add);
                myContent = myContent.Replace("[6]", temp.Country);
                myContent = myContent.Replace("[7]", temp.National);
                myContent = myContent.Replace("[8]", temp.Phone);
                myContent = myContent.Replace("[9]", temp.Hotel);
                myContent = myContent.Replace("[10]", temp.City);
                myContent = myContent.Replace("[11]", temp.Arrival);
                myContent = myContent.Replace("[12]", temp.Dep);
                myContent = myContent.Replace("[13]", temp.Roomtype);
                myContent = myContent.Replace("[14]", temp.OtherRoom);
                myContent = myContent.Replace("[15]", temp.Bed);
                myContent = myContent.Replace("[16]", temp.OtherBed);
                
                myContent = myContent.Replace("[17]", temp.NumberOfRoom);
                myContent = myContent.Replace("[18]", temp.NumberOfAdults);
                myContent = myContent.Replace("[19]", temp.NumberOfChilds);
                myContent = myContent.Replace("[20]", temp.FlightNo);
                myContent = myContent.Replace("[21]", temp.Arrivaltime);
                myContent = myContent.Replace("[22]", temp.Comment);
               
                return myContent;
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
